//
//  PlayerAnnotationView.m
//  projecthz
//
//  Created by tali on 16/8/10.
//  Copyright © 2016年 tali. All rights reserved.
//

#import "PlayerAnnotationView.h"

@interface PlayerAnnotationView ()

@property (nonatomic, strong) UIImageView *leftImage;
@property (nonatomic, strong) UIImageView *rightImage;

@end

@implementation PlayerAnnotationView

#pragma mark - Init
-(instancetype)initWithAnnotation:(id<MKAnnotation>)annotation reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithAnnotation:annotation reuseIdentifier:reuseIdentifier];
    if (self) {
        [self configUI];
    }
    return self;
}

- (void)configUI{
//    self.leftCalloutAccessoryView = self.leftImage;
//    self.detailCalloutAccessoryView = self.rightImage;
}

#pragma mark - Public Methods
- (void)updateViewWithImageName:(NSString *)imageStr{
    self.leftImage.image = [UIImage imageNamed:imageStr];
    self.rightImage.image = [UIImage imageNamed:imageStr];
}

#pragma mark - Getters
-(UIImageView *)leftImage{
    if (!_leftImage) {
        _leftImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
    }
    return _leftImage;
}

-(UIImageView *)rightImage{
    if (!_rightImage) {
        _rightImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 15, 15)];
    }
    return _rightImage;
}

@end
